<?php
	require("../include/connectdb.php");
	$type=$_GET['type'];
	$s=null;
	switch($type){
		case 'dm': 
			$s="domain";
			break;
		case 'pm': 
			$s="phanmem";
			break;
		case 'sp': 
			$s="sanpham";
			break;
		case 't2': 
			$s="tintuc";
			break;
		case 'tv': 
			$s="tuvan";
			break;
		case 'w': 
			$s="web";
			break;
		case 'dv': 
			$s="dichvu";
			break;					
	}
	$sql="select * from ".$s." order by ".$type."Id DESC";
	$res=mysql_query($sql);
	while($r=mysql_fetch_array($res)){
?>
<div class="grid_5 alpha">
	<p><?php echo substr($r[$type.'Title'],0,150);?> </p>
	<br>
	<p><?php echo substr($r[$type.'Detail'],0,150);?></p>
	<br>
	<div align="right"><a>Thêm</a><a>S?a</a><a>Xóa</a></div>
</div>
<div class="grid_5 omega">
<?php
	$r=mysql_fetch_array($res);
?>
<p><?php echo substr($r[$type.'Title'],0,150);?> </p>
	<br>
	<p><?php echo substr($r[$type.'Detail'],0,150);?></p>
	<br>
	<div align="right"><a href="#">Chi tiết</a>&nbsp;&nbsp;<a href="main.php?page=eart&type=<?php echo $type; ?>&ID=<?php echo $r[$type.'Id']; ?>">Sửa</a>&nbsp;&nbsp;<a>Xóa</a></div>
</div>
<?php
}
?>